<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>简历列表</title>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.16.custom.css" />
<link rel="stylesheet" type="text/css" href="css/validator.css" />
<link rel="stylesheet" href="css/howitworks.css" />
<link rel="stylesheet" href="css/common.css" />
<link rel="stylesheet" href="css/pixie.css" />

<style type="text/css" title="currentStyle">
@import "css/demo_page.css";

@import "css/demo_table.css";
@import "css/jquery-ui-1.8.16.custom.css";
</style>

<script type="text/javascript" language="javascript" src="js/jquery-1.6.4.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.js"></script>

<script type="text/javascript" language="javascript" src="js/jquery.bgiframe-2.1.2.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.ui.core.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.ui.widget.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.ui.mouse.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.ui.button.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.ui.draggable.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.ui.position.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.ui.resizable.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.ui.dialog.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.effects.core.js"></script>
	
<style>
	body { font-size: 62.5%; }
	input.text { margin-bottom:12px; width:95%; padding: .4em; }
	fieldset { padding:0; border:0; margin-top:25px; }
	h1 { font-size: 1.2em; margin: .6em 0; }
	div#users-contain { width: 350px; margin: 20px 0; }
	div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
	div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
	.ui-dialog .ui-state-error { padding: .3em; }
	.validateTips { border: 1px solid transparent; padding: 0.3em; }
</style>
	
<% 
String permLevel = session.getAttribute( "perm-level") == null ? "0" : session.getAttribute( "perm-level").toString(); 
%>

<script type="text/javascript" charset="utf-8">

window.onbeforeunload = function()
{
	if(Math.abs(event.clientX - document.body.clientWidth) < 30)
	{
		if (confirm('确实要退出简历管理？'))
			window.location.href("login.action");
		else
			event.returnValue = '请点取消留在本页面！';
	}
}

$(document).ready(function() {
	$("#mode").val(0);
	
	permControl();
	
    $('#searchRes').dataTable( {
    	"bAutoWidth": false,
    	"bJQueryUI": false,
    	"iDisplayLength": 15,
    	"aLengthMenu": [15, 25, 50],
    	//"sAjaxSource": "sources/arrays.txt",
        "sPaginationType": "full_numbers",
        	"aoColumns": [
			{ "bVisible": false, "asSorting": [ "desc" ] },
			null,
			null
			]
    }
    );
    
} );

function openNew() {
	window.open ('page.html', 'newwindow', 'fullscreen')
}

</script>

<script>
	$(function() {
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		$( "#dialog:ui-dialog" ).dialog( "destroy" );
		
		function updateTips( t ) {
			tips
				.text( t )
				.addClass( "ui-state-highlight" );
			setTimeout(function() {
				tips.removeClass( "ui-state-highlight", 1500 );
			}, 500 );
		}

		function checkLength( o, n, min, max ) {
			if ( o.val().length > max || o.val().length < min ) {
				o.addClass( "ui-state-error" );
				updateTips( "Length of " + n + " must be between " +
					min + " and " + max + "." );
				return false;
			} else {
				return true;
			}
		}

		function checkRegexp( o, regexp, n ) {
			if ( !( regexp.test( o.val() ) ) ) {
				o.addClass( "ui-state-error" );
				updateTips( n );
				return false;
			} else {
				return true;
			}
		}
		
	});
	
	function permControl() {
		var permLevel = <%=permLevel%>;
		function permControl() {
			var permLevel = <%=permLevel%>;
			if ((permLevel % 100000) / 10000 < 1) {
				$( "#createUser" ).hide();
			}
			if ((permLevel % 1000000) / 100000 < 1) {
				$( "#createUser" ).hide();
			}
			if ((permLevel % 10000000) / 1000000 < 1) {
				$( "#createUser" ).hide();
			}
		}
	}
	
	function openDownloadChoiceDialog() {
		$( "#downloadChoiceDialog" ).dialog( "open" );
	}
	function openSearchDailog() {
		$( "#dialog-form" ).dialog( "open" );
	}
	function writeXls() {
		$("#isWriteXlsMode").val(1);
		document.getElementById("resume-filter").submit();
	}
</script>
</head>
<body  id="dt_example">
<div class="top_bar">
	<ul class="nav">
		<li><span class="SayHi">欢迎: 
			<%=session.getAttribute("username")%>
		</span>
		</li>
		<li id="search">
			<a href="/resume/resume-main.action?page=0&pageSize=10">返回首页</a>
		</li>
		<li id="search">
			<a href="/resume/resume-list.action">搜索简历</a>
		</li>
		<li id="createResume">
			<a href="/resume/resume-insert.action">新建简历</a>
		</li>
		<li id="managerResume">
			<a href="/resume/resume-manager.action">简历管理</a>
		</li>
		<li id="createUser">
			<a href="/resume/user-create.action">新建用户</a>
		</li>
		<li id="userList">
			<a href="/resume/audit-list.action?page=0&pageSize=20">日志</a>
		</li>
		<li>
			<a href="/resume/login.action">退出</a>
		</li>
	</ul>
</div>
<br />
<br />
	<div id="container" style="float:left; margin-left:10px;">
		<!-- <s:form action="resume-list" method="post"> -->
				<table cellpadding="0" cellspacing="0" border="0" class="display"
					id="searchRes">
					<thead>
						<tr>
							<th>ID</th>
							<th>姓名</th>
							<th>权限</th>
						</tr>
					</thead>
					<tbody>
						<s:iterator value="userList" id="content" status="st">
							<tr>
								<td><s:property value='#st.index' /></td>
								<td>
									<s:url id="url_user" value="/user-create.action">
										<s:param name="userId" value="%{#content.id}"></s:param>
									</s:url> 
									<s:a href="%{url_user}">
										<s:property value="%{#content.userName}" />
									</s:a>
								</td>
								<td><s:property value="%{#content.perm}" /></td>
							</tr>
						</s:iterator>
					</tbody>
					<tfoot>
						<tr>
							<th>ID</th>
							<th>姓名</th>
							<th>权限</th>
						</tr>
					</tfoot>
				</table>
		<!-- </s:form> -->
	</div>
</body>
</html>